export default {
	data() {
		return {
			feedbackTitle: "",
			feedbackTxt: ""
		}
	},
	onLoad() {

	},
	methods: {
		async onFeedback() {
			if (this.feedbackTxt) {
				const newsRes = await this.$uniCloudCallFunction({
					name: "xxf-feedback",
					action: "createFeedback",
					data: {
						uid: this.$store.state.login.uid,
						title: this.feedbackTitle,
						content: this.feedbackTxt
					}
				});
				console.log("newsRes: ", newsRes);
				if (newsRes && newsRes.id) {
					await this.$utils.showToast(this, {
						message: '反馈成功！',
						mode: 1
					});
					this.feedbackTitle = "";
					this.feedbackTxt = "";
				}
			} else {
				await this.$utils.showToast(this, {
					message: '您还未输入内容！',
					mode: 2
				});
			}
		}
	}
}